package cmcciot.onenet.nbapi.sdk.api.online;

import cmcciot.onenet.nbapi.sdk.entity.CommonEntity;
import okhttp3.Callback;
import org.json.JSONObject;

/**
 * Created by zhuocongbin
 * date 2018/3/16
 */
public abstract class BasicOpe {
    /**
     * The Api key.
     */
    protected String apiKey;

    /**
     * Instantiates a new Basic ope.
     *
     * @param apiKey the api key
     */
    public BasicOpe(String apiKey) {
        this.apiKey = apiKey;
    }

    /**
     * Operation json object.
     *
     * @param commonEntity the common entity
     * @param body         the body
     * @return the json object
     */
    public abstract JSONObject operation(CommonEntity commonEntity, JSONObject body);

    /**
     * Operation.
     *
     * @param commonEntity the common entity
     * @param body         the body
     * @param callback     the callback
     */
    public abstract void operation(CommonEntity commonEntity, JSONObject body, Callback callback);
}
